<?php

$accion = $_GET['accion'];
$objEncriptar = new Encriptador();
switch ($accion) {

    case "encriptar": $objEncriptar->Encriptar();
        break;
    case "desencriptar": $objEncriptar->Desencriptar();
        break;
}

class Encriptador {

    function Encriptar() {
        $dato = $_GET['dato'];
        echo base64_encode($dato);
    }

    function Desencriptar() {
        $dato = $_GET['dato'];
        echo base64_decode($data);
    }

}

?>
